import { FishController } from "./FishController";
import { Fish } from "../Obj/Fish";
import { _xSpeed } from "../../../../../../this/_xSpeed";
type int = number;
//class PowerForceFishController
    
    export  class PowerForceFishController extends FishController
    {
        constructor(arg1: number=3, arg2: number=0.05, arg3: number=0.1, arg4: int=1)
        {
            super();
            this._maxSpeed = arg1;
            this._minSpeed = arg3;
            this._decPer = arg2;
            this._horizontalDirection = arg4;
            this._xSpeed = this._maxSpeed;
            return;
        }

        public /* override */ autoRun(): void
        {
            if (this._xSpeed != 0) 
            {
                this._xSpeed = this._xSpeed - this._xSpeed * this._decPer;
            }
            else 
            {
                this._xSpeed = this._maxSpeed;
            }
            this._xSpeed = this._xSpeed < this._minSpeed ? 0 : _xSpeed;
            (_target as Fish).xSpeed = this._xSpeed;
            (_target as Fish).horizontalDirection = this._horizontalDirection;
            var loc1;
            var loc2=((loc1 = this)._count + 1);
            loc1._count = loc2;
            return;
        }

        /* internal */ /* var */_maxSpeed: number;

        /* internal */ /* var */_minSpeed: number;

        /* internal */ /* var */_decPer: number;

        /* internal */ /* var */_xSpeed: number;

        /* internal */ /* var */_horizontalDirection: int;

        /* internal */ /* var */_count: int=0;
    }
